package com.wing.config;

import com.wing.order.model.response.EnterpriseVO;
import com.wing.order.service.EnterpriseServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;

@Component
public class BaseDataInit {

    public static EnterpriseVO ENTERPRISE_DATA;

    public static Long ENTERPRISE_ID;

    public static String ENTERPRISE_CODE;

    public static String ENTERPRISE_NAME;

    @Autowired
    private EnterpriseServiceImpl enterpriseService;

    @PostConstruct
    public void  init(){
        ENTERPRISE_DATA=enterpriseService.getEnterpriseVo();
        ENTERPRISE_ID=Long.valueOf(ENTERPRISE_DATA.getId());
        ENTERPRISE_CODE=ENTERPRISE_DATA.getCode();
        ENTERPRISE_NAME=ENTERPRISE_DATA.getName();
    }

}
